﻿#include "CoinManager.h"
#include "Coin.h"
//静态变量要在类外做初始化，不然会报错
CoinManager* CoinManager::pInstance = nullptr;

CoinManager::CoinManager() {

}

CoinManager::~CoinManager() {
	clearList();
}

void CoinManager::addCoin(Coin* coin) {
	coinList.push_back(coin);
}

void CoinManager::collection(Coin* coin) {
	coinList.remove(coin);
	coin->removeFromParent();
}

void CoinManager::clearList() {
	coinList.clear();
}